package com.micro.frog.fortune.sdk.cwl.enums;

import com.baomidou.mybatisplus.annotation.EnumValue;
import lombok.Getter;

/**
 * 报告类型
 *
 * @author Jason.lv
 * @since 2022/2/22 11:30
 */
public enum CwlReportType {
    /**
     * 报告类型
     */
    snsp(1, "单个号码在单个位置出现的概率"),
    snnp(2, "单个号码出现的总概率"),
    ;

    @Getter
    @EnumValue
    private final Integer code;
    @Getter
    private final String desc;

    CwlReportType(Integer code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public static CwlReportType getByCode(Integer code){
        for (CwlReportType anEnum : values()) {
            if (anEnum.code.equals(code)){
                return anEnum;
            }
        }
        return null;
    }
}
